#########################################################################
### This file includes the installation of basic app for desktop ver  ###
### The OS version is : Ubuntu 18.04 desktop                          ###
#########################################################################
#! /bin/bash

## openssh-server 是针对ubuntu desktop版本的，server版本只需要配置sshd_config文件即可
# echo y | sudo apt install vim openssh-server

## 安装python3.8, 对于ubuntu 20.04来说，默认已经安装了python3.8
echo y | sudo apt install python3.8

## 配置python3.8 为默认
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 2
sudo update-alternatives --config python3
# 选择作为默认python的那个即可

## 安装完了python3.8 需要更新一下系统并安装python3-dev，否则报错：Python.h 未找到
sudo apt update
echo y | sudo apt install python3-dev

## 安装 pip3
echo y | sudo apt install python3-pip

## arm平台对conda的适配比较差，不建议在arm linux下安装conda, 如果你是x86_64平台，那么可以直接安装miniconda, 
## Miniconda url: https://repo.anaconda.com/miniconda
sudo mkdir -p /usr/local/src/Miniconda

cd /usr/local/src/Miniconda/ && wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
sudo sh Miniconda3-latest-Linux-x86_64.sh

## 检查一下 cuda版本
echo y | sudo apt install nvidia-cuda-toolkit
nvcc -V